<?php
/**
 * Created by PhpStorm.
 * User: yaohuif
 * Date: 2019/1/30
 * Time: 16:49
 */
namespace App\Services;

class AuthService
{
    /**
     * 获取admin信息
     *
     * @param string $login_name 用户名
     * @param string $password 密码
     *
     **/
    public function get_admin_info($login_name, $password)
    {
        try {
            return Admin::where([
                'login_name' => $login_name,
                'password' => md5($password)
            ])->select('admin_id', 'admin_name', 'login_name', 'avatar', 'state')->first();
        } catch (\Exception $e) {
            return Responser::error($e->getMessage());
        }
    }

}
